<?php
    require '../common.php';
     $key = isset($_POST["key"])?$_POST["key"]:"";

 $articles =  getAll("select article.*,tag.name as tag_name from article left join tag on 
               article.tag_id=tag.id where article.name like '%$key%'");

 $smarty->assign("key",$key);
 $smarty->assign("articles",$articles);

$smarty->display("article.html");
 // require 'templates/article.html';
?>